/*
 * File:    SpaceEncoder.java
 * Created: 06-Nov-2007
 * 
 * by Kenji Hollis <kenji@bitgatesoftware.com>
 * Released under the Creative Commons License version 2.5
 */

package com.bitgate.util.encoder;

/**
 * This helper class is used to encode strings for filenames that contain spaces.  This is for encoding
 * requests that are made through MIME-capable readers such as MIME E-Mail, HTTP, and SOAP.
 * 
 * @author Kenji Hollis &lt;kenji@bitgatesoftware.com&gt;
 * @since 0.1
 */
public class SpaceEncoder
{
	/**
	 * Takes a string and space-encodes it for URLs requests.
	 * 
	 * @param str The <code>String</code> to encode.
	 * @return The encoded <code>String</code>.
	 */
	public static String spaceEncode(String str)
	{
		return str.replaceAll(" ", "%20");
	}
}